package com.ktjiaoyu.yuanzihuan.controller;


import com.ktjiaoyu.yuanzihuan.bean.IndexImg;
import com.ktjiaoyu.yuanzihuan.service.IndexImgService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping(value = "/imgindex")
public class ImgIndexController {

    @Resource
    private IndexImgService indexImgService;

    @RequestMapping(value = "/getimg")
    @ResponseBody
    public List<IndexImg> getimg(@RequestParam("imgType") String imgType) {
        List<IndexImg> list = indexImgService.findByEnabledOrderByImgOrderDescBiz(1, imgType);
        return list;
    }
}
